home *** CD-ROM | disk | FTP | other *** search
/ Developer Helper 1: Phil & Dave's Excellent CD / Excellent CD HFS.raw / HyperCard / HyperCard 1.2.2 International / HyperCard Dutch (K-1.2.2) / Meer stapels / Verkoopresultaten / card_3600.txt < prev    next >
Text File  |  1988-12-21  |  3KB  |  110 lines

  1. -- card: 3600 from stack: in
  2. -- bmap block id: 2439
  3. -- flags: 0000
  4. -- background id: 2620
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: A002
  11. -- rect: left=433 top=277 right=301 bottom=509
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Bijwerken
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   put the userLevel into saveLevel
  23.   if the userLevel < 3 then set userLevel to 3 -- "Painting"
  24.   if the userLevel < 3 then exit mouseUp
  25.   put frameBottom()-frameHeight()+10 into pieTop
  26.   put frameLeft()+5 into pieLeft
  27.   put frameHeight()-20 into pieDiameter
  28.  
  29.   clearScreen
  30.   reset paint
  31.   choose oval tool
  32.   set lineSize to 2
  33.   set dragSpeed to 0
  34.   drag from pieLeft,pieTop to pieLeft+pieDiameter, pieTop+pieDiameter
  35.   set centered to false
  36.  
  37.   put the number of lines in field "Data" into dataCount
  38.   put zero into total
  39.   repeat with i = 1 to dataCount
  40.     add line i of field "Data" to total
  41.   end repeat
  42.   put "Totaal is" && total into background field "Total"
  43.  
  44.   put pieDiameter div 2 into pieRadius
  45.   put pieLeft+pieRadius into pieCenterX
  46.   put pieTop+pieRadius into pieCenterY
  47.  
  48.   choose line tool
  49.   put zero into angle
  50.   put zero into change
  51.   repeat with i = 1 to dataCount+1
  52.     put pieCenterX + round(pieRadius * sin(angle)) into x
  53.     put pieCenterY - round(pieRadius * cos(angle)) into y
  54.     choose line tool
  55.     drag from pieCenterX,pieCenterY to x,y
  56.     if change > .02 then
  57.       set pattern to getPattern(i)
  58.       choose bucket tool
  59.       click at halfX, halfY
  60.     end if
  61.  
  62.     get line i of field "data"
  63.     put pi * it / total into change
  64.     add change to angle
  65.     put pieCenterX + round((pieRadius-3) * sin(angle)) into halfX
  66.     put pieCenterY - round((pieRadius-3) * cos(angle)) into halfY
  67.     add change to angle
  68.  
  69.   end repeat
  70.   reset paint
  71.   choose browse tool
  72.   set userLevel to saveLevel
  73. end mouseUp
  74.  
  75. function getPattern selector
  76. return item (selector mod 12)+1 of "2,13,11,3,14,6,21,17,31,18,4,32"
  77. end getPattern
  78.  
  79.  
  80. -- part 2 (button)
  81. -- low flags: 00
  82. -- high flags: 0001
  83. -- rect: left=477 top=29 right=48 bottom=504
  84. -- title width / last selected line: 0
  85. -- icon id / first selected line: 0 / 0
  86. -- text alignment: 1
  87. -- font id: 0
  88. -- text size: 12
  89. -- style flags: 0
  90. -- line height: 16
  91. -- part name: 
  92.  
  93.  
  94. -- part contents for background part 5
  95. ----- text -----
  96. 35
  97. 35
  98. 30
  99.  
  100.  
  101.  
  102.  
  103.  
  104. -- part contents for background part 9
  105. ----- text -----
  106. Totaal is 100
  107.  
  108. -- part contents for background part 11
  109. ----- text -----
  110. Omzetverdeling in klantenbudget